import request from '@/services/request'
/**
 * 用户修改接口
 * @param data putParams
 * @returns
 */
export type putParams = {
  avatar: string
  name: string
  nickName: string
  phone: string
  sex: string
}
export const userPutService = (data: putParams) => {
  return request.put('/user/api/v1/info/update', data)
}

/**
 * 返回用户信息接口
 * @param
 * @returns
 */

export const getUserInfoService = () => {
  return request.get('/user/api/v1/info/detail')
}

/**
 *用户上传头像
 * @param file File
 * @returns string
 */
export const putAvatarService = (file: File) => {
  return request.post('/user/api/v1/common/upload', {
    file,
  })
}
